home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qrangecontrol.h.z / qrangecontrol.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  2.2 KB  |  91 lines

  1. /****************************************************************************
  2. ** $Id: qrangecontrol.h,v 2.4 1998/07/03 00:09:52 hanord Exp $
  3. **
  4. ** Definition of QRangeControl class
  5. **
  6. ** Created : 940427
  7. **
  8. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  9. **
  10. ** This file is part of Qt Free Edition, version 1.40.
  11. **
  12. ** See the file LICENSE included in the distribution for the usage
  13. ** and distribution terms, or http://www.troll.no/free-license.html.
  14. **
  15. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  16. ** your own programs or libraries.
  17. **
  18. ** Please see http://www.troll.no/pricing.html for information about 
  19. ** Qt Professional Edition, which is this same library but with a
  20. ** license which allows creation of commercial/proprietary software.
  21. **
  22. *****************************************************************************/
  23.  
  24. #ifndef QRANGECONTROL_H
  25. #define QRANGECONTROL_H
  26.  
  27.  
  28. class QRangeControl
  29. {
  30. public:
  31.     QRangeControl();
  32.     QRangeControl( int minValue, int maxValue,
  33.            int lineStep, int pageStep, int value );
  34.  
  35.     int        value()        const;
  36.     void    setValue( int );
  37.     void    addPage();
  38.     void    subtractPage();
  39.     void    addLine();
  40.     void    subtractLine();
  41.  
  42.     int        minValue()    const;
  43.     int        maxValue()    const;
  44.     void    setRange( int minValue, int maxValue );
  45.  
  46.     int        lineStep()    const;
  47.     int        pageStep()    const;
  48.     void    setSteps( int line, int page );
  49.  
  50. protected:
  51.     void    directSetValue( int val );
  52.     int        prevValue()    const;
  53.  
  54.     virtual void valueChange();
  55.     virtual void rangeChange();
  56.     virtual void stepChange();
  57.  
  58. private:
  59.     void    adjustValue();
  60.  
  61.     int        minVal, maxVal;
  62.     int        line, page;
  63.     int        val, prevVal;
  64.  
  65. private:    // Disabled copy constructor and operator=
  66.     QRangeControl( const QRangeControl & );
  67.     QRangeControl &operator=( const QRangeControl & );
  68. };
  69.  
  70.  
  71. inline int QRangeControl::value() const
  72. { return val; }
  73.  
  74. inline int QRangeControl::prevValue() const
  75. { return prevVal; }
  76.  
  77. inline int QRangeControl::minValue() const
  78. { return minVal; }
  79.  
  80. inline int QRangeControl::maxValue() const
  81. { return maxVal; }
  82.  
  83. inline int QRangeControl::lineStep() const
  84. { return line; }
  85.  
  86. inline int QRangeControl::pageStep() const
  87. { return page; }
  88.  
  89.  
  90. #endif // QRANGECONTROL_H
  91.